package com.example.xpvideo.Controller;

import com.example.xpvideo.entity.PageResult;
import com.example.xpvideo.entity.ResponseResult;
import com.example.xpvideo.entity.req.PhpMerchantsApplyReq;
import com.example.xpvideo.entity.req.UpdateReq;
import com.example.xpvideo.entity.req.UserListReq;
import com.example.xpvideo.entity.res.PhpLocalAdminRes;
import com.example.xpvideo.entity.res.PHPMerchantsApplyListRes;
import com.example.xpvideo.service.PhpMerchantsApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author : 洪俊新
 * @date : 2021/8/26 14:32
 * @description:
 */
@RestController
@RequestMapping("/back/phpmerchantsapply")
public class PhpMerhcnatsApplyController {
    @Autowired
    private PhpMerchantsApplyService phpMerchantsApplyService;


    /**
     * 所有用户列表
     * */
    @GetMapping("/list")
    public ResponseResult<PageResult<List<PHPMerchantsApplyListRes>>> list(PhpMerchantsApplyReq phpMerchantsApplyReq)
            throws Exception{
        return phpMerchantsApplyService.list(phpMerchantsApplyReq);
    }

    @PostMapping("/merchantsaudit")
    public ResponseResult<Object> merchantsAudit(@RequestBody @NotNull UpdateReq updateReq) throws Exception{
        return phpMerchantsApplyService.merchantsAudit(updateReq);
    }

    @PostMapping("/localmerchantsaudit")
    public ResponseResult<Object> localMerchantsAudit(@RequestBody @NotNull UpdateReq updateReq) throws Exception{
        return phpMerchantsApplyService.LocalmerchantsAudit(updateReq);
    }
}
